'use strict';

// With background scripts you can communicate with popup
// and contentScript files.
// For more information on background script,
// See https://developer.chrome.com/extensions/background_pages


let viewTabId;

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
  if (request.type === 'FPS') {
    chrome.tabs.sendMessage(viewTabId, { type: 'RECORD', payload: request.payload })
  }

  if (request.type === 'VIEW_TAB_ID') {
    viewTabId = request.viewTabId;
  }
});